var webpack = require('webpack');
var path = require('path');

module.exports = {
	context: __dirname+'/src',
	entry:{
		rootbundle:"./js/root.js",
		adminbundle:"./js/admin.js"    //后台文件
	},     
	module:{
		loaders:[{
			test:/\.js?$/,
			exclude:/(node_modules)/,
			loader: "babel-loader",
			query:{
				presets:['react','es2015'],
				plugins:['react-html-attrs'],//html和js的语法不冲突eg：class直接解析成类名而不是关键字
			}
		},
		{
			test:/\.css$/,
			loader:'style-loader!css-loader'
			//test:/\.css$/,
			//loader:'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]__[hash:base64:5]'
			//test: /\.css$/,
            //loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
		}]
	},
	output:{
		path:__dirname+"/src/",
		filename:"[name].js"
	}
}